package com.zhihesj.anan.message;

import lombok.Getter;

/**
 * 统一对返回结果进行封装 的枚举类
 * @author anan.
 * @version 1.0
 * @create 2020-04-20 14-54
 */
@Getter
public enum MessageCodeEnum {
    //    成功
    SUCCESS(true, 20000,"成功"),
    LOGIN_SUCCESS(true, 20001,"登陆成功"),
    LOGOUT_SUCCESS(true, 20002,"退出成功"),
    DELETE_SUCCESS(true, 20003,"删除成功"),
    UPDATE_SUCCESS(true, 20004,"修改成功"),
    ADD_SUCCESS(true, 20005,"新增成功"),

//    失败
    BAD_SQL_GRAMMAR(true, 21001, "sql语法错误"),
    JSON_PARSE_ERROR(true, 21002, "json解析异常"),
    PARAM_ERROR(true, 21003, "参数不正确"),
    FILE_UPLOAD_ERROR(true, 21004, "文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(true, 21005, "Excel数据导入错误"),
    LOGIN_FAILURE(true, 21006,"登陆失败"),
    ACCESS_FAILURE(true,21007,"权限验证失败"),
    AUTHENTICATION_FAILURE(true,21008,"身份验证失败"),
    USERNAME_IS_NULL(true,21009,"用户名不能为空"),
    PASSWORD_IS_NULL(true,21010,"密码不能为空"),
    ARRAY_IS_NULL(true,21011,"没有传入要删除的ID号数组！"),
    UNKNOWN_REASON(true, 21012, "未知错误"),
    STATE_ERROR(true, 21013,"state错误"),
    API_ERROR(true, 21014,"接口USER调用为空，github接口不稳定"),
    GET_USER_ERROR(true, 21015,"获取用户失败"),
    HAVE_CHILDRENDEPT_NOT_DELETE(true,21016,"该部门下有子部门，不得删除"),
    OPERATION_ERROR(true,21017,"操作失败"),
    SELECT_ERROR(true,21018,"查询失败"),
    USER_EDIT_ERROR(true,21019,"主用户不得修改"),
    ROLE_EDIT_ERROR(true,21020,"管理员角色不得修改或删除"),
    ROLE_DEFAULT_ERROR(true,21021,"必须要有一个默认角色"),
    DELETE_ERROR(true,21022,"删除失败"),
    ROLE_NOT_DITE_DEFAULT(true,21023,"默认角色不得修改"),
    ROLE_IDENTIFIERNULL_ERROR(true, 21024,"角色identifier为空"),

    WEIXIN_REQUEST_TSUCCESS(true,0,"请求成功"),
    WEIXIN_SYSTEM_BUSY(true,-1,"系统繁忙"),
    WEIXIN_APPSECRET_ERROR(true,40001,"AppSecret错误或者AppSecret不属于这个公众号，请开发者确认AppSecret的正确性"),
    WEIXIN_GRANT_TYPE_ERROR(true,40002,"请确保grant_type字段值为client_credential"),
    WEIXIN_INTERFACE_ERROR(true,40164,"调用接口的IP地址不在白名单中，请在接口IP白名单中进行设置。"),
    WEIXIN_IP_ERROR(true,89503,"此IP调用需要管理员确认,请联系管理员"),
    WEIXIN_IP_WAIT(true,89501,"此IP正在等待管理员确认,请联系管理员"),
    WEIXIN_24H_ERROR(true,89506,"24小时内该IP被管理员拒绝调用两次，24小时内不可再使用该IP调用"),
    WEIXIN_1H_ERROR(true,89507,"1小时内该IP被管理员拒绝调用一次，1小时内不可再使用该IP调用"),
    WEIXIN_TOKEN_ERROR(true,89508,"token过期"),
    WEIXIN_UPDATE_NULL_ERROR(true,89508,"上传失败，或者为空"),
    WEIXIN_FILE_FORMAT_ERROR(true,89509,"文件超过限制大小或者格式不对，后缀错误"),
    WEIXIN_FILE_NULL_ERROR(true,89510,"下载文件不存在"),
    WEIXIN_REQUEST_ERROR(true,89511,"请求失败")

    ;



    private Boolean success;
    private Integer code;
    private String message;
    private MessageCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }
}
